package by.gravity.billprinter.utils;

import android.app.Activity;
import android.view.inputmethod.InputMethodManager;

public class GlobalUtils {

	public static void hideSoftKeyboard(Activity activity) {

		if (activity != null) {
			InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
			if (inputMethodManager != null) {
				if (activity.getCurrentFocus() != null && activity.getCurrentFocus().getWindowToken() != null) {
					inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
				}
			}

		}
	}

}
